﻿Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Or TextBox2.Text = "" Then
            MsgBox("Favor preencher os campos corretamente", MsgBoxStyle.Information, "Atenção")
        Else
            LOGINTableAdapter.FillByLOGIN(LOGINDataSet.LOGIN, TextBox1.Text, TextBox2.Text)
            If LOGINDataSet.Tables(0).Rows.Count > 0 Then
                Me.Hide()
                Principal.Show()
            Else
                MsgBox("Login ou senha errados,favor verificar.", MsgBoxStyle.Information, "Atenção")
            End If
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

    Private Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown
        Select Case e.KeyCode
            Case Keys.Enter
                SendKeys.Send("{Tab}")
                SendKeys.Send("{ENTER}")
                End Select
    End Sub
End Class
